package com.kaikeba.t31.ticket.service.impl;

import com.kaikeba.t31.core.service.impl.CrudServiceImpl;
import com.kaikeba.t31.ticket.dao.CarriageDao;
import com.kaikeba.t31.ticket.po.Carriage;
import com.kaikeba.t31.ticket.service.ICarriageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class CarriageServiceImpl extends CrudServiceImpl<Carriage> implements ICarriageService {
    @Resource
    private CarriageDao carriageDao;
    @Override
    public boolean saveOrUpdate(Carriage carriage) {
        System.out.println("test");
        if(carriage.getId() == null){
            carriageDao.insert(carriage);
        } else {
            carriageDao.updateById(carriage);
        }
        return true;
    }
}
